import reques from '@/utils/request'
// 获取部门的列表
export function getDepartment() {
  return reques({
    url: '/company/department'
  })
}
// 获取部门负责人
export function getUserSimple() {
  return reques({
    url: '/sys/user/simple'
  })
}

/**
 * 新增组织
 * ***/
export function addDepartment(data) {
  return reques({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 获取部门详情
 *
 * ***/

export function getDepartmentDetail(id) {
  return reques({
    url: `/company/department/${id}`
  })
}

/**
 * 编辑部门详情
 *
 * ***/

export function updateDepartment(data) {
  return reques({
    url: `/company/department/` + data.id,
    method: 'put',
    data
  })
}

/**
 * 删除部门
 *
*/

export function delDepartment(id) {
  return reques({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

